package com.ygou.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.ygou.service.AnnouncementService;
import com.ygou.service.CountService;
import com.ygou.service.OrdersService;
import com.ygou.service.UsersService;

@Controller
@RequestMapping(value = "/num")
@SessionAttributes(value = {"map","nullmap","sum"})
public class CountController {
	@Autowired
	CountService countService;
	@Autowired
	AnnouncementService announcementService;
	
	@RequestMapping(value = "/count")
	public String Count(ModelMap model) {
		Map<String, Object> nullmap=countService.count();
		Map<String, Object> map=countService.countByExample();
		int sum=countService.sum();
		model.put("sum", sum);
		model.put("map", map);
		model.put("nullmap", nullmap);
		return "/admin/index";
	}
}
